//
//  AnimatorUtil.m
//  RJETGeography
//
//  Created by RJET04 on 2023/8/29.
//

#import "AnimatorUtil.h"

@implementation AnimatorUtil

static AnimatorUtil *animatorInstance = nil;

+(instancetype)sharedInstance
{
    @synchronized (self) {
        if (animatorInstance == nil) {
            animatorInstance = [[AnimatorUtil alloc] init];
        }
    }
    return animatorInstance;
}

- (void)show
{
    self.animator = [[ZYAnimator alloc] initAnimateWithType:ZYAnimateTypeLineY tintColor:THEME_COLOE];
    self.animator.frame = CGRectMake(SCREEN_WIDTH/2-50, SCREEN_HEIGHT/2-50, 100, 100);
    [self.animator startAnimation];
    [[UIApplication sharedApplication].keyWindow addSubview:self.animator];
}

- (void)dismiss
{
    [self.animator stopAnimate];
    [self.animator removeFromSuperview];
}

@end
